package com.itec.learn.java.design.factory.simple;

import com.itec.learn.java.design.factory.CheesePizza;
import com.itec.learn.java.design.factory.GreekPizza;
import com.itec.learn.java.design.factory.Pizza;
import com.itec.learn.java.design.factory.SimplePizza;

/**
 * @author chenyiqun
 */
public class PizzaStore {
    SimplePizzaFactory factory;

    public PizzaStore(SimplePizzaFactory factory){
        this.factory = factory;
    }

    public Pizza orderPizza(String type){

        Pizza pizza = factory.createPizza(type);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();

        return pizza;
    }
}
